package com.itheima.home_work.net_shop;

public class Product implements Comparable<Product> {
    private int id;
    private String name;
    private String types;
    private double price;
    private int sales;
    private int inventory;

    public Product() {
    }

    public Product(int id, String name, String types, double price, int sales, int inventory) {
        this.id = id;
        this.name = name;
        this.types = types;
        this.price = price;
        this.sales = sales;
        this.inventory = inventory;
    }

    @Override
    public int compareTo(Product o) {
        int result = 0;
        result = Integer.compare(this.sales, o.sales);
        return result;
    }

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", types='" + types + '\'' +
                ", price=" + price +
                ", sales=" + sales +
                ", inventory=" + inventory +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTypes() {
        return types;
    }

    public void setTypes(String types) {
        this.types = types;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getSales() {
        return sales;
    }

    public void setSales(int sales) {
        this.sales = sales;
    }

    public int getInventory() {
        return inventory;
    }

    public void setInventory(int inventory) {
        this.inventory = inventory;
    }
}
